0 CLEAR1000:DIMK(255),X,Y,Z,X1,X2,D,AL,TP,RY,RL,FL,VC,CH,XC,YC,CY,PC,P,R,XX,YY,TT,LN,PN,J0,J1,ST,VE,T,F,G,H,M,N,S,T,U,V,W,C
1 DIM A$,B$,S1$,S2$
2 CLS:PRINT"PLEASE WAIT...":PRINT@231,"FLIGHT SIMULATOR 5":GOSUB9000:GOTO8000
3 POKEVC,CH:RETURN
4 POKEVC,Z:RETURN
5 J0=J0-8:XX=XX-1:IFJ0<8THENJ0=8:XX=48
6 RETURN
7 J0=J0+8:XX=XX+1:IFJ0>56THENJ0=56:XX=54
8 RETURN
9 J1=J1-8:YY=YY-1:IFJ1<8THENJ1=8:YY=39
10 RETURN
11 J1=J1+8:YY=YY+1:IFJ1>56THENJ1=56:YY=45
12 RETURN
30 XC=0:YC=R:PC=3-2*R 
35 GOSUB70
40 IFPC<0THENPC=PC+4*XC+6:GOTO50
45 PC=PC+4*(XC-YC)+10:YC=YC-1   
50 XC=XC+1 
55 IFXC<YCTHEN35
60 IFXC=YCTHENGOSUB70 
65 RETURN
70 XX=CX+XC:YY=CY+YC:D=USR((INT(XX)*N+INT(YY))*PN)
71 XX=CX-XC:YY=CY+YC:D=USR((INT(XX)*N+INT(YY))*PN)
72 XX=CX+XC:YY=CY-YC:D=USR((INT(XX)*N+INT(YY))*PN)
73 XX=CX-XC:YY=CY-YC:D=USR((INT(XX)*N+INT(YY))*PN)
74 XX=CX+YC:YY=CY+XC:D=USR((INT(XX)*N+INT(YY))*PN)
75 XX=CX-YC:YY=CY+XC:D=USR((INT(XX)*N+INT(YY))*PN) 
76 XX=CX+YC:YY=CY-XC:D=USR((INT(XX)*N+INT(YY))*PN)
77 XX=CX-YC:YY=CY-XC:D=USR((INT(XX)*N+INT(YY))*PN)
79 RETURN
110 GOSUB3:CLS0:PRINT@384,"";
120 FORY=1TO4:FORX=1TO32:READT
130 ONTGOTO140,142,144,146,147,148,150,152,154,160
135 PRINTCHR$(128);:GOTO160
140 PRINTCHR$(191);:GOTO160
142 PRINTCHR$(135);:GOTO160
144 PRINTCHR$(139);:GOTO160
146 PRINTCHR$(170);:GOTO160
147 PRINTCHR$(143);:GOTO160
148 PRINTCHR$(138);:GOTO160
150 PRINTCHR$(159);:GOTO160
152 PRINTCHR$(175);:GOTO160
154 PRINTCHR$(149);:GOTO160
160 NEXT:NEXT:POKEVE,M
190 D=USR((W*N+22)*LN+W*N+21)
210 D=USR((34*N+24)*LN+35*N+24)
215 D=USR((W*N+26)*LN+W*N+27)
220 D=USR((30*N+24)*LN+29*N+24)
225 D=USR(((20/F)*N+INT(146/F))*LN+INT(237/F)*N+INT(146/F))
230 D=USR(((0/F)*N+(96/F))*PN)
235 D=USR(((G/F)*N+(96/F))*PN)
240 R=5:CX=19:CY=170/F:GOSUB30
242 R=5:CX=30:CY=170/F:GOSUB30
244 R=6:CX=19:CY=170/F:GOSUB30
246 R=6:CX=30:CY=170/F:GOSUB30
248 FORT=0TO16:PRINT@T,B$;:NEXT
262 D=USR(((20/F)*N+INT(188/F))*LN+(40/F)*N+INT(188/F))
265 D=USR((INT(22/F)*N+INT(178/F))*PN)
270 D=USR((INT(22/F)*N+INT(154/F))*PN)
290 D=USR((0*N+47)*LN+63*N+47)
300 FORT=16384TO16638:S1$=S1$+CHR$(PEEK(T)):NEXT
310 FORT=16640TO16894:S2$=S2$+CHR$(PEEK(T)):NEXT
910 GOSUB4:CLS
1010 PRINT"        FLIGHT SIMULATOR":PRINT
1015 PRINT"  STEER YOUR PLANE BY USING:"
1020 PRINT" w FORWARD TO DIVE, z BACK TO"
1030 PRINT" CLIMB, a LEFT TO TURN LEFT,"
1040 PRINT" AND s RIGHT TO TURN RIGHT."
1045 PRINT:PRINT"   PRESS ANY KEY TO CONTINUE."
1110 A$=INKEY$:IFA$=""THEN1110
1210 CLS:PRINT"          INSTRUMENTS":PRINT
1310 PRINT"  FROM LEFT TO RIGHT THEY ARE:"
1315 PRINT" altimeter-TO JUDGE ALTITUDE"
1330 PRINT" roll indicator-TO JUDGE TURNS"
1335 PRINT" climb/dive indicator-TO JUDGE"
1340 PRINT" ANGLE OF FLIGHT"
1345 PRINT" radar-TO READ THE LOCATION OF"
1350 PRINT" THE RUNWAY"
1360 PRINT" stick indicator-TO FINE"
1370 PRINT" TUNE THE CONTROL SURFACES"
1410 PRINT" fuel gauge-FLIGHT TIME LEFT"
1420 PRINT
1430 PRINT"   PRESS ANY KEY TO CONTINUE."
1510 A$=INKEY$:IFA$=""THEN1510
1610 CLS:PRINT"         WARNING LIGHTS"
1620 PRINT
1630 PRINT"  A red flashing signal LIGHT"
1640 PRINT" MEANS THAT YOUR INCLINE IS TOO"
1650 PRINT" STEEP. IF YOU DON'T CORRECT"
1660 PRINT" THIS IMMEDIATELY, YOU WILL"
1670 PRINT" STALL AND GO INTO A STEEP DIVE."
1710 PRINT"  A green flashing signal LIGHT"
1720 PRINT" MEANS THAT YOU HAVE REACHED"
1730 PRINT" THE NECESSARY HEIGHT AND YOU"
1740 PRINT" MAY RETURN TO THE RUNWAY."
1810 PRINT:PRINT"  HIT ANY KEY TO BEGIN FLIGHT."
1910 A$=INKEY$:IFA$=""THEN1910
2120 CLS0:GOSUB3:J0=32:J1=48:Y=96:P=1:X=0:CY=0:XX=51:YY=44:Z=0
2210 FORP=ZTOVE:A$=INKEY$:IFA$<>""THENONK(ASC(A$))GOSUB5,7,9,11
2310 IFAL>635THENCY=CY+(J0-TT)/F:GOTO2410
2320 CY=Z:X=X-(J0-TT)/F
2410 X=X-CY/10
2510 IFY>4THENY=Y+(J1-TT)/6:GOTO2710
2520 Y=5
2710 AL=AL+.50*(Y-96)
3010 IFAL>3200THENAL=3200:TP=1:POKEVE,Z
3020 IFAL>ZTHEN3310
3110 IFY<82THEN4910
3210 IFTP=1AND(X>-15AND X<15)THEN5810
3220 GOTO4910
3310 PRINT@Z,S1$;B$;S2$;:POKEVE,M:IFAL<635AND(Y>1ANDY<145)THEN6510
3510 IFY>STHEN4410
3520 ST=Z
3610 IFY+CY>ZANDY+CY<GANDY-CY>ZANDY-CY<HTHEND=USR((Z+INT((Y+CY)/F))*LN+16128+INT((Y-CY)/F))
3620 D=USR((XX*N+42)*PN):D=USR((13056+YY)*PN):D=USR((6912+INT(((Y-96)/10+170)/F))*LN+8448+INT((170-(Y-96)/10)/F))
3710 D=USR((4096+INT(((-1*CY)/12+170)/F))*LN+5632+INT((CY/12+170)/F))
3720 D=USR((1280+INT((186-AL/100)/F))*LN+2304+INT((186-AL/100)/F))
4010 IFX<-14THEND=USR(690628906):GOTO4110
4020 IFX>14THEND=USR(757738794):GOTO4110
4030 D=USR(724183850)
4110 P=1:FL=FL+.03:D=USR((14336+INT((160+FL)/F))*PN):IFFL>20THEN4410
4210 NEXT
4220 END
4310 REM ***STALL***
4410 ST=ST+1:POKE16864,G:IFST<6THEN3610
4510 FORQ=1TO5:SOUND100,3:SOUND1,1:GOSUB3:FORC=1TOQ*100:NEXT:NEXT
4520 FORQ=GTO10STEP-10:SOUNDQ,1:NEXTQ:GOSUB3:Y=-20:AL=AL-500
4610 IFFL>20THEN4910
4710 GOTO3610
4810 REM ***CRASH***
4910 SOUND1,1:GOSUB3
5010 IFY>ZANDX+AL/5+2>=ZANDX+AL/5+2<=GTHEND=USR((INT((X+AL/5+2)/F)*N+INT(S/F))*LN+INT(U/F)*N+INT(Y/F))
5110 IFY>ZANDX-AL/5+G>=ZANDX-AL/5+G<=GTHEND=USR((INT((X-AL/5+G)/F)*N+INT(S/F))*LN+INT(U/F)*N+INT(Y/F))
5210 IFY+CY>ZANDY-CY>ZTHEND=USR((INT((Y+CY)/F))*LN+INT(G/F)*N+INT((Y-CY)/F))
5220 FORT=1TO11:READ XX,YY,X1,Y1:D=USR((INT(XX/F)*N+INT(YY/F))*LN+INT(X1/F)*N+INT(Y1/F)):NEXT
5410 FORQ=1TO1000:NEXT:CLS0
5510 SOUND1,10:GOSUB3
5610 GOTO7710
5710 REM ***LAND***
5810 FORQ=1TO5
5910 FORE=1TO3:SOUND100,1:NEXTE:GOSUB3
6010 FORC=1TO(5-Q)*50:NEXT
6110 NEXTQ
6210 FORQ=1TO10:SOUND50,1:NEXTQ:GOSUB3
6310 FORQ=1TO1000:NEXT:GOTO7410
6410 REM ***RUN WAY***
6510 IFX+AL/5>-2ANDX+AL/5<253THEND=USR((INT((X+AL/5+2)/F)*N+36)*LN+W*N+INT(Y/F))
6610 IFX-AL/5>-GANDX-AL/5<ZTHEND=USR((INT((X-AL/5+G)/F)*N+36)*LN+W*N+INT(Y/F))
6710 RL=RL+.25:IFRL>.75THENRL=.25
6810 RY=Y+RL*(S-Y)
6910 X1=RL*X
7010 IFX1>-128ANDX1<UTHEND=USR((INT((X1+U)/F)*N+INT(RY/F))*PN)
7110 IFY>ZTHEND=USR((W*N+INT(Y/F))*PN)
7210 GOTO3510
7310 REM *** LAND ***
7410 GOSUB4:CLS:PRINT:PRINT"      GOOD LANDING PILOT!":PRINT
7420 PRINT" YOU SUCCESSFULLY LANDED WITH"
7430 PRINT(INT((20-FL)*100))/100;"GALLONS OF FUEL LEFT IN":PRINT" THE TANK."
7510 PRINT:PRINT:PRINT"   DO YOU WISH TO FLY AGAIN?":A$=INKEY$
7610 A$=INKEY$:IFA$=""THEN7610
7615 IFA$="Y"THENRUN
7620 IFA$="N"THENP=64000:GOTO4210
7630 GOTO7610
7710 REM *** CRASH ***
7810 GOSUB4:CLS:PRINT:PRINT"          YOU CRASHED!":PRINT
7820 PRINT" NEXT TIME BE SURE TO BE AWARE"
7830 PRINT" OF YOUR ALTIMETER, YOUR WARN-":PRINT" ING LIGHTS, AND YOUR FUEL."
7910 GOTO7510
8000 CLS:VC=49151:VE=16895:CH=4:Y=96:P=1:Z=0:F=4:TT=33:LN=65536:PN=65537:G=255:H=250:M=191:B$=CHR$(128):N=256:S=144
8010 K(65)=1:K(83)=2:K(87)=3:K(90)=4:U=128:W=32
8900 GOTO110
8920 REM LINE DRAW SUBROUTINE BY GREG DIONNE
8930 REM D=USR((X0*256+Y0)*65537) FOR SINGLE POINT
8940 REM D=USR((X0*256+Y0)*LN+X1*256+Y1) TO DRAW LINE
9000 DATALNPDALMMABABNNLLNMMMJAMKCCAJCFADHPAALLHAAALLEANAMLCCAJCFADHPAALMHAAALMFANNNGBBCDHCEPJHMOJHNLJGNGJHNMINDCJG
9001 DATAMKJBMMCHCIJLLLJHMKJGMOJLNHJHMOBGJANLCKABEANANMCKABFABBCFOANGNMNHNLNLNGNHNMNGMLNLLMNHMLCANAFPHOOMOCNMMKNNNI
9002 DATAJGNJMGKLDNIGIAMAFFEEEEMLFFMBFFCEPIHEAANICEABEEIKIAJHNKIGCADNNLNIIJAAIKEAIEEBNNNINONINGNKOKAAOHAADJEPJHMOJH
9003 DATANLJGNHJHNMINMAJGMLJBMNCHLGJLLMJHMLJGMOJLNGJHMOBGJANLCKABEANANMCKABFABBCFOANGNMNHNLNLNHNHNMNGMKNLLLNHMKCANA
9004 Z=32768:FORX=0TO3:READA$::GOSUB9005:NEXTX:Z=277:A$="HOIAAA"
9005 FORY=1TOLEN(A$)/2:POKEZ,(ASC(MID$(A$,2*Y-1,1))-65)*16+ASC(MID$(A$,2*Y,1))-65:Z=Z+1:NEXTY:RETURN
9200 DATA 2,1,4,0,0,1,1,1,0,0,0,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,3
9210 DATA 1,1,4,0,0,1,1,0,0,0,0,0,1,0,0,0,0,0,1,1,1,1,1,1,1,4,1,1,0,1,1,1
9220 DATA 1,1,4,0,0,1,1,0,0,0,0,0,1,0,0,0,0,0,1,1,0,0,0,9,5,6,5,7,0,1,1,1
9230 DATA 1,1,4,0,0,1,1,1,0,0,0,2,1,3,0,0,0,1,1,1,1,1,1,1,1,8,1,1,5,1,1,10
9300 DATA 0,0,70,20
9301 DATA 70,20,50,70
9302 DATA 50,70,128,96
9303 DATA 128,96,100,100
9304 DATA 100,100,70,130
9305 DATA 70,130,0,144
9306 DATA 255,0,240,50
9307 DATA 240,50,140,60
9308 DATA 140,60,128,96
9309 DATA 128,96,144,120
9310 DATA 144,120,220,110
